package com.bwie.service.impl;

import com.bwie.mapper.CustomerMapper;
import com.bwie.pojo.dto.CustomerDto;
import com.bwie.pojo.po.Customer;
import com.bwie.pojo.po.User;
import com.bwie.service.CustomerService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Service
public class CustomerServiceImpl implements CustomerService {

    @Autowired
    private CustomerMapper customerMapper;


    @Override
    public PageInfo<Customer> customerList(CustomerDto customerDto) {
        PageHelper.startPage(customerDto.getPageNum(),customerDto.getPageSize());
        List<Customer> customerList =customerMapper.customerList(customerDto);
        PageInfo<Customer> customerPageInfo = new PageInfo<>(customerList);
        return customerPageInfo;
    }


}
